
<%@page contentType="text/html" pageEncoding="UTF-8" import="java.util.List,java.util.Iterator, Modelo.Fuente" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@page import = "java.util.*" %>
<%@page import = "Modelo.*" %>
<%@page import = "javax.swing.*"%>

<jsp:useBean id="encuesta" scope="request" class="Modelo.Encuesta" />

<jsp:useBean id="proy" scope="request" class="Modelo.Proyecto" />
<%
//esto es para que no guarde en el cache la pagina
        response.setHeader("Cache-Control", "max-age=0");
        response.setHeader("Cache-Control", "no-cache");
        response.setHeader("Cache-Control", "no-store");
        response.setHeader("Pragma", "no-cache");
        response.setDateHeader("Expires", -1);
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Autoevaluacion</title>
        <link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css" media="screen" />
         <link type="text/css" href="<%=request.getContextPath()%>/jQuery/css/custom-theme/jquery-ui-1.8.4.custom.css" rel="Stylesheet" />
        <script  type="text/javascript" src="<%=request.getContextPath()%>/jQuery/development-bundle/ui/ui.core.js"></script>
        <script  type="text/javascript" src="<%=request.getContextPath()%>/jQuery/development-bundle/ui/ui.draggable.js"></script>
        <script  type="text/javascript" src="<%=request.getContextPath()%>/jQuery/development-bundle/ui/ui.droppable.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/jQuery/js/jquery-1.3.2.min.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/jQuery/js/jquery-ui-1.7.2.custom.min.js"></script>
        <style type="text/css">
            #listaOrigen { float: left; width: 45%; min-height: 18em; background: #E0E0E0; padding: 1%;}
            * html .lista { height: 12em; } /* IE6 */
            .item { float: left; width: 280px; padding: 0.4em; margin: 0 0.4em 0.4em 0; text-align: left;list-style-type:none; }
            .titulo{background: white; text-align: center}
            #listaDestino { float: right; width: 45%; min-height: 18em; padding: 1%;
                background: #E0E0E0}
            * html #trash { height: 18em; } /* IE6 */
            .titulo{background: white; text-align: center}
        </style>
        <style type="text/css">
            #listaOrigen3 { float: left; width: 45%; min-height: 18em; background: #E0E0E0; padding: 1%;}
            * html .lista3 { height: 12em; } /* IE6 */
            .item3 { float: left; width: 280px; padding: 0.4em; margin: 0 0.4em 0.4em 0; text-align: left;list-style-type:none; }
            .titulo3{background: white; text-align: center}
            #listaDestino3 { float: right; width: 45%; min-height: 18em; padding: 1%;
                background: #E0E0E0}
            * html #trash { height: 18em; } /* IE6 */
            .titulo3{background: white; text-align: center}
        </style>

        <script type="text/javascript">
            $(function() {
                $("#datepicker").datepicker();
            });
        </script>

        <script type="text/javascript">
            $(function() {
                $("#tabs").tabs({
                    event: 'mouseover'
                });
            });
        </script>
        <script  type="text/javascript">
            $(document).ready(function(){
                $(".item").draggable({helper: 'clone' , cursor: 'move'});



                $(".lista").droppable({
                    accept: ".item",
                    drop: function(ev, ui) {
                        // Añado el objeto origen a la lista destino
                        $(this).append($(ui.draggable));
                    }
                });


            });
        </script>
        <script type="text/javascript">
            var num=0;
            // Funcion para crear lineas de objetos
            function crear(idenc) {
                num++;
                fi = document.getElementById('na'); // 1
                contenedor = document.createElement('div'); // 2
                contenedor.id = 'div'+num; // 3
                fi.appendChild(contenedor); // 4

                ele = document.createElement('input'); // 5
                ele.type = 'hidden'; // 6
                ele.name = 'encuesta'+num;
                ele.id =idenc;
                ele.value = idenc;
                contenedor.appendChild(ele); // 7
            }
            function borrar(obj) {
                fi = document.getElementById('na'); // 1
                fi.removeChild(document.getElementById(obj)); // 10
                num=num-1;
                //alert(num);

            }
        </script>
    </head>

    <body>
        <%
                    String programa = (String) request.getParameter("pro");
                  //  String proyecto = (String) request.getParameter("proyecto");
                    HttpSession s = request.getSession();
                    if (s.getAttribute("logged") != null && s.getAttribute("logged").equals(true)) {

        %>

                            <form method="post" id="form25" name="form25" action="<%=request.getContextPath()%>/proyecto/crearP1.jsp">
                                <div id="tabs">
                                    <ul>
                                        <li><a href="#tabs-1">1. Nuevo Proyecto</a></li>

                                    </ul>
                                    <div id="tabs-1" style="height: 380px">
                                        <h3>Nuevo Proyecto</h3>
                                        <p>programa:&nbsp;<%=programa%></p>
                                        <p>Fecha de Inicio: <input id="datepicker" name="fecha" type="text"></p>
                                        <input type="hidden" name="programa" value="<%=programa%>">

                                    </div>
                                  </div>
                                <div id="na2"></div>
                                <input type="submit" id="botonResultado" value="Crear Proyecto">
                            </form>


        <%} else {
            response.sendRedirect(request.getContextPath() + "/index.jsp");
        }%>
    </body>
</html>
